<template>
	<view class="carry_pet">
		<view class="close" @click="$emit('close')">
			<image :src="`${baseImageUrl}/common/close1.png`"></image>
		</view>
		<view class="title">
			<view>携带宠物</view>
		</view>
		<view class="pet_image">
			<view class="img_box">
				<image :src="pet_cover"></image>
			</view>
		</view>
		<view class="sub_title">
			<image :src="`${baseImageUrl}/home/xs.png`"></image>
			<text>宠物技能</text>
		</view>
		<scroll-view scroll-y class="scroll_view">
			<view class="list">
				<view class="item" v-for="item in list">
					<image :src="item.skill.img"></image>
					<text>{{item.skill.name}}</text>
				</view>
			</view>
		</scroll-view>
		<!-- <view class="list">
			<view class="item" v-for="item in list">
				<image :src="item.skill.img"></image>
				<text>{{item.skill.name}}</text>
			</view>
		</view> -->
	</view>
</template>

<script>
	import {
		userInfo
	} from '@/request/api.js';
	export default {
		data() {
			return {
				pet_cover: "",
				list: [],
				show: false
			}
		},
		async created() {
			let {
				user,
				pet,
				pet_kill
			} = await userInfo();
			this.pet_cover = pet.product_cover;
			this.list = pet_kill;
		}
	}
</script>

<style scoped lang="scss">
	.carry_pet {
		width: 688rpx;
		height: 606rpx;
		padding: 35rpx 40rpx;
		box-sizing: border-box;
		background: url(#{$baseImageUrl}/bg/688_606.png) no-repeat;
		background-size: 100% 100%;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		align-items: center;
		position: relative;

		.close {
			width: 122rpx;
			height: 122rpx;
			position: absolute;
			right: 0rpx;
			top: 0rpx;
			transform: translate(50rpx, -45rpx);
			z-index: 2;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.title {
			display: flex;
			justify-content: center;
			align-items: center;

			view {
				width: 256rpx;
				height: 30rpx;
				line-height: 30rpx;
				text-align: center;
				color: #494338;
				font-size: 42rpx;
				font-weight: 400;
				font-family: LiSu;
				background: url(#{$baseImageUrl}/home/title.png) no-repeat;
				background-size: 100% 100%;
			}
		}

		.pet_image {
			padding: 10rpx 0;
			box-sizing: border-box;
			display: flex;
			justify-content: center;

			.img_box {
				width: 220rpx;
				height: 220rpx;
				box-sizing: border-box;
				background: url(#{$baseImageUrl}/home/pet.png) no-repeat;
				background-size: 100% 100%;
				display: flex;
				justify-content: center;
				align-items: center;
			}

			image {
				width: 160rpx;
				height: 160rpx;
				border-radius: 50%;
			}
		}

		.sub_title {
			display: flex;
			align-items: center;

			image {
				width: 32rpx;
				height: 32rpx;
			}

			text {
				line-height: 32rpx;
				color: #494338;
				font-size: 32rpx;
				font-weight: 400;
				font-family: SimSun;
				padding-left: 12rpx;
				box-sizing: border-box;
			}
		}

		.scroll_view {
			height: 200rpx;

			.list {
				display: flex;
				justify-content: space-between;
				flex-wrap: wrap;

				.item {
					width: 50%;
					margin-top: 15rpx;
					display: flex;
					align-items: center;

					image {
						width: 40rpx;
						height: 40rpx;
						border-radius: 50%;
					}

					text {
						color: #494338;
						font-size: 28rpx;
						font-weight: 400;
						font-family: SimSun;
						padding-left: 5rpx;
						box-sizing: border-box;
					}
				}
			}
		}
	}
</style>